{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 单量子比特含噪模拟器\n",
    "\n",
    "\n",
    "*版权所有 (c) 2021 百度量子计算研究所，保留所有权利。*"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 内容概要\n",
    "\n",
    "本教程将介绍如何使用量脉的单量子比特含噪模拟器，定义退相干噪声（decoherence noise）和振幅失真噪声（amplitude noise），并通过自定义的控制脉冲实现量子门。本教程大纲如下：\n",
    "\n",
    "- 背景介绍\n",
    "- 准备工作\n",
    "- 自定义模拟器参数\n",
    "- 拉比振荡校准 $\\pi$ 脉冲\n",
    "- 测量弛豫时间 $T_1$\n",
    "- 用 Ramsey 实验测量失相时间 $T_2$\n",
    "- 单比特模拟器的门级控制\n",
    "- 总结"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 背景介绍\n",
    "\n",
    "在脉冲层级上，单量子比特的控制需要对物理量子比特施加控制脉冲。在本教程中，单量子比特含噪模拟器可以根据用户输入的控制脉冲和噪声参数来实现对量子比特控制的动力学演化的模拟。\n",
    "\n",
    "一个三能级的超导量子比特，经过在本征频率下的旋转坐标系转换（rotating frame）以及旋转波近似（Rotating Wave Approximation, RWA），其系统哈密顿量可以写成 \\[1\\]：\n",
    "\n",
    "$$\n",
    "\\hat{H}_{\\rm sys}(t) = \\hat{H}_{\\rm anharm} + \\hat{H}_{\\rm noise}(t) + \\hat{H}_{\\rm ctrl}(t),\n",
    "$$\n",
    "\n",
    "其中，哈密顿量的非谐项 $\\hat{H}_{\\rm anharm}$ 与物理量子比特的非谐性 $\\alpha$ 有关：\n",
    "\n",
    "$$\n",
    "\\hat{H}_{\\rm anharm} = \\frac{\\alpha}{2} \\hat{a}^\\dagger \\hat{a}^\\dagger \\hat{a}\\hat{a},\n",
    "$$\n",
    "\n",
    "其中 $\\hat{a}^\\dagger$ 以及 $\\hat{a}$ 分别是三能级量子比特的产生算符和湮灭算符。在量脉的单量子模拟器中，我们特别地引入了两种噪声项：由于与环境作用的退相干噪声以及由于失真的脉冲波形的波动引起的振幅噪声 $\\hat{H}_{\\rm amp}$ \\[1\\]:\n",
    "\n",
    "$$\n",
    "\\hat{H}_{\\rm amp}(t) = \\epsilon \\hat{H}_{\\rm ctrl}.\n",
    "$$\n",
    "\n",
    "其中，脉冲失真的噪声参数 $\\epsilon$ 的概率分布服从高斯分布：\n",
    "\n",
    "$$\n",
    "P(\\epsilon) = \\frac{1}{\\sqrt{ 2 \\pi \\sigma^2 }}e^{ - \\frac{ \\epsilon^2 } {2 \\sigma^2} }.\n",
    "$$\n",
    "\n",
    "而与退相干相关的噪声参数 $T_1$、$T_2$ 描述了量子态的密度矩阵的非对角元的衰减速率以及激发态的布居数衰减速率。可以用 Bloch-Redfield 密度矩阵 $\\rho_{BR}$ 表示初态是 $|\\psi\\rangle = \\alpha |0\\rangle + \\beta |1\\rangle$ 的量子比特在开放系统下的退相干演化 ($\\delta \\omega$ 是控制脉冲的频率和量子比特频率的差) \\[2\\]：\n",
    "\n",
    "$$\n",
    "\\rho_{BR} = \n",
    "\\begin{pmatrix} \n",
    "1 + (|\\alpha|^2 - 1)e^{-t/T_1 } & \\alpha\\beta^* e^{i\\delta \\omega t}e^{-t/T_2} \\\\\n",
    "\\alpha^* \\beta e^{-i\\delta\\omega t} e^{-t/T_2} & |\\beta|^2 e^{-t/T_1}\n",
    "\\end{pmatrix}.\n",
    "$$\n",
    "\n",
    "从上式可以看到，激发态布居数的衰减速率与 $T_1$ 有关，密度矩阵的非对角元素的衰减速率与 $T_2$ 有关。\n",
    "\n",
    "因此我们用与脉冲失真的概率分布有关的系数 $\\sigma$，以及退相干相关的系数 $T_1$、$T_2$ 来表征这两种噪声, 即用户可以通过改变这三个参数研究所模拟系统的噪声。 "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "## 准备工作\n",
    "\n",
    "成功安装量脉后，您可以按照本教程运行下面的程序。在运行此教程前，您需要从量脉（Quanlse）和其它常用的 Python 库导入以下包："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Import 1-qubit noisy simulator at the pulse level\n",
    "from Quanlse.Superconduct.Simulator import PulseModel\n",
    "from Quanlse.Superconduct.Simulator.PulseSim1Q import pulseSim1Q\n",
    "from Quanlse.QOperator import driveX, driveZ\n",
    "from Quanlse.QWaveform import gaussian, square\n",
    "from Quanlse.Utils.Functions import basis, dagger, expect, project\n",
    "from Quanlse.QOperation.FixedGate import H, X, Y, Z\n",
    "from Quanlse.QOperation.RotationGate import RX, RY, RZ\n",
    "from Quanlse.Utils.Bloch import plotBloch, rho2Coordinate\n",
    "from Quanlse.remoteSimulator import remoteSimulatorRunHamiltonian as runHamiltonian\n",
    "\n",
    "# Import tool for analysis\n",
    "from scipy.optimize import curve_fit\n",
    "from matplotlib import pyplot as plt\n",
    "from math import pi\n",
    "import numpy as np"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "使用量脉云服务之前，我们需要一个 token 来访问云端。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Import Define class and set the token for cloud service\n",
    "# Please visit http://quantum-hub.baidu.com\n",
    "from Quanlse import Define\n",
    "Define.hubToken = ''"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 自定义模拟器参数\n",
    "\n",
    "我们首先定义该模拟器的必要参数以及噪声相关的参数。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "qubitNum = 1  # The number of qubits\n",
    "dt = 0.2  # The sampling period, in nanoseconds\n",
    "level = 3  # The energy level\n",
    "anharm = -0.3472 * (2 * pi)  # The anharmonicity of the qubit, in 2 * pi * GHz\n",
    "wq = 4.9  * (2 * pi)  # The qubit frequency, in 2 * pi * GHz\n",
    "\n",
    "# Define the noise of the simulator\n",
    "ampSigma = 0.02  # amplitude (over-rotation) error\n",
    "t1 = 3000  # qubit relaxation time, in nanoseconds\n",
    "t2 = 800  # qubit dephasing time, in nanoseconds"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "创建 `PulseModel` 类的一个对象，该对象是根据上述参数定义的一个物理模型。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "qubitAnharm = {0: anharm}\n",
    "qubitFreq  = {0: wq}\n",
    "qubitT1 = {0: t1}\n",
    "qubitT2 = {0: t2}\n",
    "\n",
    "model = PulseModel(subSysNum=qubitNum, sysLevel=level, dt=dt, ampSigma=ampSigma,\n",
    "                   T1=qubitT1, T2=qubitT2, qubitFreq=qubitFreq, qubitAnharm=qubitAnharm)\n",
    "\n",
    "ham = model.createQHamiltonian()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "这样我们的模拟器的物理建模就完成了。接下来我们可以用拉比振荡实验来找到 $\\pi$ 脉冲以及 $\\pi / 2$ 脉冲对应的幅值。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 拉比振荡校准 $\\pi$ 脉冲\n",
    "\n",
    "本节中我们利用拉比振荡，即固定脉冲的持续时间，不断改变脉冲幅度并且得到 $|1\\rangle$ 态的布居数来进行 $\\pi$ 脉冲的校准实验。我们使用单量子比特模拟器来模拟这个过程。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Define the amplitudes of the pulse\n",
    "ampList = np.linspace(0, 0.4, 100)\n",
    "\n",
    "# Create a jobList object\n",
    "rabiJob = ham.createJobList()\n",
    "\n",
    "# Define the shape of the gaussian waveform\n",
    "tg = 60\n",
    "tau = tg / 2\n",
    "sigma = tg / 8\n",
    "\n",
    "# Append each job of different pulse amplitudes to jobList\n",
    "for amp in ampList:\n",
    "    wave = gaussian(t=tg, a=amp, tau=tau, sigma=sigma)\n",
    "    job = ham.createJob()\n",
    "    job.appendWave(operators=driveX, onSubSys=0, waves=wave)\n",
    "    job = model.getSimJob(job)\n",
    "    rabiJob.addJob(job)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "当定义好拉比振荡的脉冲任务后，我们将该任务以及初始态 $|\\psi\\rangle = |0\\rangle$ 传入函数 `runHamiltonian()` 里，并且将参数 `isOpen` 设为 `True` 来模拟开放系统的时间演化。 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Define the initial state for the simulation\n",
    "stateInit = basis(level, 0) \n",
    "    \n",
    "# Run the simulation of the open system evolution\n",
    "result = runHamiltonian(ham=ham, state0=stateInit, jobList=rabiJob, isOpen=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "接下来我们画出不同脉冲幅度下的激发态 $|1\\rangle$ 布居数。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Define the projector\n",
    "prj = basis(level, 1) @ dagger(basis(level, 1))\n",
    "\n",
    "popList = []\n",
    "\n",
    "# Compute the population for each job\n",
    "for res in result:\n",
    "    rho = res['state']\n",
    "    popList.append(expect(prj, rho))  # Compute the population of |1>\n",
    "\n",
    "plt.plot(ampList, popList, '.')\n",
    "plt.xlabel('Amplitudes (a.u.)')\n",
    "plt.ylabel(r'Population of $|1\\rangle$')\n",
    "plt.title('Rabi oscillation')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "然后我们拟合得到的点，获得对应的余弦函数。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Define the function to be fitted\n",
    "def fit(x, a, b, c, d):\n",
    "    return a * np.cos(b * x + c) + d\n",
    "\n",
    "# Fit the curve\n",
    "paraFit, _ = curve_fit(fit, ampList, popList, [-0.5, 2 * np.pi / 0.3, 0, 0.5])\n",
    "def yFit(x):\n",
    "    return fit(x, paraFit[0], paraFit[1], paraFit[2], paraFit[3])\n",
    "y = [yFit(x) for x in ampList]\n",
    "\n",
    "# Plot the fitted curve\n",
    "plt.plot(ampList, y)\n",
    "plt.xlabel('Amplitudes (a.u.)')\n",
    "plt.ylabel(r'Population of $|1\\rangle$')\n",
    "plt.ylim(-0.05, 1)\n",
    "plt.title('Rabi oscillation')\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "可以看到，$|1\\rangle$ 的布居数随脉冲幅值的增大呈现周期性的振荡。利用得到的拟合函数，我们只需要找到当 $|1\\rangle$ 的布居数分别是 0.5 和 1 的时对应的幅值作为 $\\pi / 2$ 脉冲以及 $\\pi$ 脉冲的幅值，并且记录下来。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ampList = np.linspace(0, 0.4, 5000)\n",
    "\n",
    "piAmp = []\n",
    "halfPiAmp = []\n",
    "for amp in ampList:\n",
    "    if abs(yFit(amp) - 0.5) < 1e-3:\n",
    "        halfPiAmp.append(amp)\n",
    "    if abs(yFit(amp) - 0.98) < 1e-3:\n",
    "        piAmp.append(amp)\n",
    "\n",
    "# find the corresponding amplitudes\n",
    "x90 = min(halfPiAmp)\n",
    "x180 = min(piAmp)\n",
    "\n",
    "# Print the results\n",
    "print(f'The amplitudes of pi/2 pulse: {x90}')\n",
    "print(f'The amplitudes of pi pulse: {x180}')   "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 测量弛豫时间 $T_1$\n",
    "\n",
    "在实验上，欲测量某个量子比特的弛豫时间 $T_1$，首先在此量子比特上施加一个 $\\pi$ 脉冲，使得激发态的布居数达到最大，然后在计算布居数随时间的演化，就能得到弛豫时间 $T_1$。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Define the idling time\n",
    "tIdle = 2 * t1\n",
    "\n",
    "# Define the wave to flip the qubit state\n",
    "wave = gaussian(t=tg, a=x180, tau=tau, sigma=sigma)\n",
    "\n",
    "# Initialize a job\n",
    "job = ham.createJob()\n",
    "\n",
    "# Firstly, apply a X gate to flip the qubit\n",
    "job.appendWave(operators=driveX, onSubSys=0, waves=wave)\n",
    "\n",
    "# Then simulate the evolution during the idling time\n",
    "job.appendWave(operators=driveX, onSubSys=0, waves=square(tIdle, 0))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "定义好脉冲任务以及初始态后，我们开始模拟系统的含时演化。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Define the initial state for the simulation\n",
    "stateInit = basis(level, 0) \n",
    "    \n",
    "# Run the simulation of the open system evolution\n",
    "result = runHamiltonian(ham=ham, state0=stateInit, job=job, isOpen=True)\n",
    "\n",
    "# Define the projector |1><1|\n",
    "prj = basis(level, 1) @ dagger(basis(level, 1))\n",
    "\n",
    "popList = []\n",
    "\n",
    "# Calculate the population of |1> during the evolution\n",
    "for rho in result[0]['evolution_history']:\n",
    "    popList.append(expect(prj, rho))\n",
    "\n",
    "# Get the maximum time of the job\n",
    "maxTime, _ = job.computeMaxTime()\n",
    "\n",
    "tList = np.linspace(0, maxTime, len(popList))\n",
    "\n",
    "# Plot the time-evolution poplulation for simulation and prediction \n",
    "plt.plot(tList, popList, '-', label='simulation')\n",
    "tIdleList = np.linspace(tg, tIdle, 20)\n",
    "plt.plot(tIdleList, np.exp(-1. / t1 * np.array(tIdleList - tg)), label='prediction')\n",
    "plt.xlabel('Time (ns)')\n",
    "plt.ylabel(r'Population of $|1\\rangle$')\n",
    "plt.title(r'$T_1$ measurement')\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "上图是激发态布居数随时间的变化图，可见从实验刚开始的几十纳秒内，施加的 $X$ 门的脉冲使得量子比特从基态激发到激发态。然后在后面的空转时间内，激发态布居数的衰减速率与理论值吻合。可以看到在时间 $t=T_1$ 秒的时候，$|1\\rangle$ 布居数大约是 $1/e$。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 用 Ramsey 实验测量失相时间 $T_2$\n",
    "\n",
    "在实验上，欲测量某个量子比特的失相时间 $T_2$，首先在此量子比特上施加一个 $\\pi/2$ 脉冲，然后再经过一段空转时间 $t_{\\rm idle}$ 后再施加 $\\pi/2$ 脉冲，得到 $|1\\rangle$ 的布居数。在这个过程中，因为驱动的频率与量子比特频率不同，所以可以观测到布居数随空转时间周期性振荡的现象。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Define the maximum idling time\n",
    "maxTime = t2\n",
    "\n",
    "# Define the detuning \n",
    "detuning = 2 * pi * 8. / maxTime\n",
    "\n",
    "# Define the job for Ramsey experiment\n",
    "tList = np.linspace(0, maxTime, 200)\n",
    "ramseyJob = ham.createJobList()\n",
    "\n",
    "for t in tList:\n",
    "    job = ham.createJob()\n",
    "    job.appendWave(driveX, 0, gaussian(t=tg, a=x90, tau=tau, sigma=sigma), compact=False)  # pi/2 pulse\n",
    "    job.appendWave(driveZ, 0, waves=square(t, detuning), compact=False)  # simulate the rotation due to the detuning\n",
    "    job.appendWave(driveX, 0, gaussian(t=tg, a=-x90, tau=tau, sigma=sigma), compact=False)  # pi/2 pulse\n",
    "    ramseyJob.addJob(job)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "定义好脉冲任务以及初始态后，我们开始模拟系统的含时演化。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Run the simulation starting with initial state |0>.\n",
    "stateInit = basis(level, 0)\n",
    "result = runHamiltonian(ham, stateInit, jobList=ramseyJob, isOpen=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "绘制布居数随空转时间的变化图。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "popList = []\n",
    "\n",
    "prj = basis(level, 1) @ dagger(basis(level, 1))\n",
    "\n",
    "for res in result:\n",
    "    rho = res['state']\n",
    "    popList.append(expect(prj, rho))\n",
    "\n",
    "plt.plot(tList, popList, '.b', label='simulation')\n",
    "plt.xlabel('Delayed time (ns)')\n",
    "plt.ylabel(r'Population of $|1\\rangle$')\n",
    "plt.legend()\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "然后我们用拟合函数拟合该曲线，并且根据拟合函数的参数估计 $T_2$。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Define the fitting function\n",
    "def fitRamsey(x, a, b):\n",
    "    return - np.cos(a * x) * np.exp(- b * x) * 0.5 + 0.5\n",
    "\n",
    "paraFit, _ = curve_fit(fitRamsey, tList, popList, [detuning, 0.])\n",
    "\n",
    "def yFit(x):\n",
    "    return fitRamsey(x, paraFit[0], paraFit[1])\n",
    "\n",
    "# Plot the result\n",
    "plt.plot(tList, popList, '.b', label='simulation')\n",
    "plt.plot(tList, yFit(tList), label='fit')\n",
    "plt.plot(tList, np.exp(- (1 / t2 + 1/(2 * t1)) * tList) * 0.5 + 0.5, label='prediction')\n",
    "plt.xlabel('Delayed time (ns)')\n",
    "plt.ylabel(r'Population of $|1\\rangle$')\n",
    "plt.legend()\n",
    "plt.show()\n",
    "\n",
    "# Print the estimated T_2 time\n",
    "print(f'The T2-dephasing time is approximately {1 / (paraFit[1] - 1 / (2 * t1))} ns')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 单比特含噪模拟器的门级控制\n",
    "\n",
    "除了从脉冲层模拟单量子比特的操作外，我们也可以直接从编译好的逻辑门层面直接使用该模拟器。\n",
    "首先，我们直接调用一个已经预设好的单量子比特的 `PulseSim1Q()` 的对象."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "model = pulseSim1Q(dt=0.2)\n",
    "ham = model.createQHamiltonian()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "然后对该量子比特设置一系列不同的门操作。这里，我们首先定义一组单量子比特门。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "H(model.Q[0])\n",
    "X(model.Q[0])\n",
    "Y(model.Q[0])\n",
    "Z(model.Q[0])\n",
    "H(model.Q[0])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "调用方法 `model.schedule()` 来生成定义好的门的脉冲序列，然后调用 `runHamiltonian` 模拟开放系统下单量子比特在退相干情况下的时间演化。该演化可以通过调用绘制量子态在布洛赫球上的演化的函数 `plotBloch()` 来可视化。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "job = model.schedule()\n",
    "\n",
    "res = runHamiltonian(ham, state0=basis(3, 0), job=job, isOpen=True)\n",
    "\n",
    "history = res[0]['evolution_history']\n",
    "\n",
    "posList = []\n",
    "\n",
    "for rho in history:\n",
    "    rho2d = project(rho, 1, 3, 2) / np.trace(rho)\n",
    "    posList.append(rho2Coordinate(rho2d))\n",
    "    \n",
    "plotBloch(posList, save=True, mode='animate')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "可以看到，在退相干比较严重的情况下，量子态的布洛赫矢量无法保持在球面上——也就是说量子态从纯态演化成混合态，密度矩阵的非对角元衰减，系统与外界作用的时候发生信息的损失。因此当量子比特的 $T_1$ 以及 $T_2$ 较短的情况下，由退相干带来的噪声不利于深度比较大的量子电路。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 总结\n",
    "\n",
    "本教程介绍了如何使用量脉对考虑部分噪声的超导单量子比特的控制进行模拟，并可视化结果。用户可以点击这个链接 [tutorial-single-qubit-noisy-simulator.ipynb](https://github.com/baidu/Quanlse/blob/main/Tutorial/CN/tutorial-single-qubit-noisy-simulator-cn.ipynb) 跳转到此 Jupyter Notebook 文档相应的 GitHub 页面来获取相关代码，并尝试不同于本教程的参数值来进一步探索量脉单量子比特含噪模拟器模块的功能。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 参考文献\n",
    "\n",
    "\\[1\\] [Carvalho, Andre RR, et al. \"Error-robust quantum logic optimization using a cloud quantum computer interface.\" *arXiv preprint arXiv:2010.08057* (2020).](https://arxiv.org/abs/2010.08057)\n",
    "\n",
    "\\[2\\] [Krantz, Philip, et al. \"A quantum engineer's guide to superconducting qubits.\" *Applied Physics Reviews* 6.2 (2019): 021318.](https://aip.scitation.org/doi/abs/10.1063/1.5089550)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.12"
  },
  "metadata": {
   "interpreter": {
    "hash": "7be487a71edfee40ee9e1dc32bed50d9e676671dca83e39ddadf692080d38b9a"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
